package com.syyo.admin.config.datasource;



import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;


/**
 * @author: wang
 * @date: 2021/8/11 18:13
 * @Description:
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        System.out.println("数据源为："+DataSourceContextHolder.getDB());
        return DataSourceContextHolder.getDB();
    }
}
